#ifndef BUFFEREDBYTESTREAM_H
#define BUFFEREDBYTESTREAM_H

#include "ByteStream.h"

class BufferedByteStream: public ByteStream
{
public:
	BufferedByteStream();
	~BufferedByteStream();

	void Flush();

	virtual void Write(const void *data, unsigned int size);
	virtual unsigned int Read(void *data, unsigned int size);
	virtual void WriteToFile(const char *filename);
	virtual void WriteRaw(const void *data, unsigned int size);
	virtual unsigned int ReadRaw(void *data, unsigned int size);


protected:
	virtual void Clear();

private:
	const static unsigned int BUFFERSIZE = 8*1024;

	unsigned int bufferpos;
	unsigned char buffer[BUFFERSIZE];

	

	BufferedByteStream(const BufferedByteStream& rhs); // copy constructor not implemented yet
};

#endif //BUFFEREDBYTESTREAM_H
